Optimal. Leaf size=286 \[ \frac {a (A b-a B) c F_1\left (\frac {1}{2};\frac {1-m}{2},1;\frac {3}{2};\sin ^2(e+f x),-\frac {b^2 \sin ^2(e+f x)}{a^2-b^2}\right ) (c \cos (e+f x))^{-1+m} \cos ^2(e+f x)^{\frac {1-m}{2}} \sin (e+f x)}{b \left (a^2-b^2\right ) f}-\frac {(A b-a B) F_1\left (\frac {1}{2};-\frac {m}{2},1;\frac {3}{2};\sin ^2(e+f x),-\frac {b^2 \sin ^2(e+f x)}{a^2-b^2}\right ) (c \cos (e+f x))^m \cos ^2(e+f x)^{-m/2} \sin (e+f x)}{\left (a^2-b^2\right ) f}-\frac {B (c \cos (e+f x))^{1+m} \, _2F_1\left (\frac {1}{2},\frac {1+m}{2};\frac {3+m}{2};\cos ^2(e+f x)\right ) \sin (e+f x)}{b c f (1+m) \sqrt {\sin ^2(e+f x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.27, antiderivative size = 286, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 5, integrand size = 33, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.152, Rules used = {3081, 2722,
2902, 3268, 440} \begin {gather*} \frac {a c (A b-a B) \sin (e+f x) \cos ^2(e+f x)^{\frac {1-m}{2}} (c \cos (e+f x))^{m-1} F_1\left (\frac {1}{2};\frac {1-m}{2},1;\frac {3}{2};\sin ^2(e+f x),-\frac {b^2 \sin ^2(e+f x)}{a^2-b^2}\right )}{b f \left (a^2-b^2\right )}-\frac {(A b-a B) \sin (e+f x) \cos ^2(e+f x)^{-m/2} (c \cos (e+f x))^m F_1\left (\frac {1}{2};-\frac {m}{2},1;\frac {3}{2};\sin ^2(e+f x),-\frac {b^2 \sin ^2(e+f x)}{a^2-b^2}\right )}{f \left (a^2-b^2\right )}-\frac {B \sin (e+f x) (c \cos (e+f x))^{m+1} \, _2F_1\left (\frac {1}{2},\frac {m+1}{2};\frac {m+3}{2};\cos ^2(e+f x)\right )}{b c f (m+1) \sqrt {\sin ^2(e+f x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 440
Rule 2722
Rule 2902
Rule 3081
Rule 3268
Rubi steps
\begin {align*} \int \frac {(c \cos (e+f x))^m (A+B \cos (e+f x))}{a+b \cos (e+f x)} \, dx &=\frac {B \int (c \cos (e+f x))^m \, dx}{b}-\frac {(-A b+a B) \int \frac {(c \cos (e+f x))^m}{a+b \cos (e+f x)} \, dx}{b}\\ &=-\frac {B (c \cos (e+f x))^{1+m} \, _2F_1\left (\frac {1}{2},\frac {1+m}{2};\frac {3+m}{2};\cos ^2(e+f x)\right ) \sin (e+f x)}{b c f (1+m) \sqrt {\sin ^2(e+f x)}}+\frac {(a (A b-a B)) \int \frac {(c \cos (e+f x))^m}{a^2-b^2 \cos ^2(e+f x)} \, dx}{b}-\frac {(A b-a B) \int \frac {(c \cos (e+f x))^{1+m}}{a^2-b^2 \cos ^2(e+f x)} \, dx}{c}\\ &=-\frac {B (c \cos (e+f x))^{1+m} \, _2F_1\left (\frac {1}{2},\frac {1+m}{2};\frac {3+m}{2};\cos ^2(e+f x)\right ) \sin (e+f x)}{b c f (1+m) \sqrt {\sin ^2(e+f x)}}+\frac {\left (a (A b-a B) c (c \cos (e+f x))^{2 \left (-\frac {1}{2}+\frac {m}{2}\right )} \cos ^2(e+f x)^{\frac {1}{2}-\frac {m}{2}}\right ) \text {Subst}\left (\int \frac {\left (1-x^2\right )^{\frac {1}{2} (-1+m)}}{a^2-b^2+b^2 x^2} \, dx,x,\sin (e+f x)\right )}{b f}-\frac {\left ((A b-a B) (c \cos (e+f x))^m \cos ^2(e+f x)^{-m/2}\right ) \text {Subst}\left (\int \frac {\left (1-x^2\right )^{m/2}}{a^2-b^2+b^2 x^2} \, dx,x,\sin (e+f x)\right )}{f}\\ &=\frac {a (A b-a B) c F_1\left (\frac {1}{2};\frac {1-m}{2},1;\frac {3}{2};\sin ^2(e+f x),-\frac {b^2 \sin ^2(e+f x)}{a^2-b^2}\right ) (c \cos (e+f x))^{-1+m} \cos ^2(e+f x)^{\frac {1-m}{2}} \sin (e+f x)}{b \left (a^2-b^2\right ) f}-\frac {(A b-a B) F_1\left (\frac {1}{2};-\frac {m}{2},1;\frac {3}{2};\sin ^2(e+f x),-\frac {b^2 \sin ^2(e+f x)}{a^2-b^2}\right ) (c \cos (e+f x))^m \cos ^2(e+f x)^{-m/2} \sin (e+f x)}{\left (a^2-b^2\right ) f}-\frac {B (c \cos (e+f x))^{1+m} \, _2F_1\left (\frac {1}{2},\frac {1+m}{2};\frac {3+m}{2};\cos ^2(e+f x)\right ) \sin (e+f x)}{b c f (1+m) \sqrt {\sin ^2(e+f x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(10482\) vs. \(2(286)=572\).
time = 27.02, size = 10482, normalized size = 36.65 \begin {gather*} \text {Result too large to show} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.24, size = 0, normalized size = 0.00 \[\int \frac {\left (c \cos \left (f x +e \right )\right )^{m} \left (A +B \cos \left (f x +e \right )\right )}{a +b \cos \left (f x +e \right )}\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: TypeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int \frac {{\left (c\,\cos \left (e+f\,x\right )\right )}^m\,\left (A+B\,\cos \left (e+f\,x\right )\right )}{a+b\,\cos \left (e+f\,x\right )} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________